package com.jstyle.jclife.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.jstyle.jclife.R;
import com.jstyle.jclife.model.StepData;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2018/7/12.
 */

public class HistoryHeartWeekAdapter extends RecyclerViewBaseAdapter {


    public HistoryHeartWeekAdapter(List<StepData> stepDataList) {
        super(stepDataList);

    }

    @Override
    protected void bindData(BaseViewHolder holder, int position) {
        HistoryStepYearViewHolder historyStepWeekViewHolder=(HistoryStepYearViewHolder)holder;
        StepData stepData= (StepData) mDataList.get(position);
        historyStepWeekViewHolder.buttonHistoryYear.setText(stepData.getDate());
        historyStepWeekViewHolder.buttonHistoryYearData.setText(stepData.getStep()+stepData.getShowLabel());
    }

    @Override
    protected int getLayoutId(int viewType) {
        return R.layout.item_history_year;
    }

    @Override
    public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(getLayoutId(viewType), parent, false);
        BaseViewHolder baseViewHolder = new HistoryStepYearViewHolder(view);
        return baseViewHolder;
    }
    class HistoryStepYearViewHolder extends BaseViewHolder {
        @BindView(R.id.button_history_year)
        Button buttonHistoryYear;
        @BindView(R.id.button_history_year_data)
        Button buttonHistoryYearData;

        public HistoryStepYearViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }
    }


}
